#pragma once

#include <zenox/glm.hpp>
#include <zenoui/Rect.hpp>

namespace zenoui {

struct BezierCurveDrawBaked;

struct BezierCurveDraw {
    glm::vec2 p1, p2, cp1, cp2;
    size_t numSegs;
    float width;
    glm::vec2 position_at_parameter(float t) const;
    BezierCurveDrawBaked bake() const;
};

struct BezierCurveDrawBaked {
    float width;
    std::vector<glm::vec2> points;
    glm::vec2 minpos, maxpos;

    glm::vec2 position_at_parameter(float t) const;
    void paint(glm::vec4 const &color);
    bool contains(glm::vec2 const &pos) const;
};

}
